package com.fishingwithme.infrastructure.mapper;

import com.fishingwithme.domain.credit.CreditRecord;
import com.fishingwithme.infrastructure.dtos.credit.CreditAvailableDto;
import com.fishingwithme.infrastructure.dtos.credit.CreditSum;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface CreditMapper extends BaseMapper<CreditRecord> {
    IPage<CreditRecord> list(Page<CreditRecord> page, @Param("userId") Long fisherId);

    Boolean hasMarked(Long dailyLoginMark, Long userId, String today);

    CreditSum selectCreditSum(Long userId);

    CreditAvailableDto getSpotCreditAvailable(Long spotId, Long userId, Long ruleId);

    int setCredit(Long spotId, Integer credit,Long userId);
}
